/**
 * @author        hejiyang <silentmanager@163.com>
 * @date          2024-11-18 20:22:14
 * Copyright © YourCompanyName All rights reserved
 */
import request from '@/config/axios'
import { ApiResponse } from '@/types/ref'

// 用户申请类型配置
export const createCustomerLimitConfig = async (data: {
  level: string //客户类型
  userIds: number[] //用户id
  maxCount: number //数量
  onceCount: number
}) => {
  return await request.request<ApiResponse<boolean>>({
    url: `/crm/customer-limit-config/create`,
    method: 'POST',
    data
  })
}

// 获取用户申请类型
export const getByUserIdCustomerLimitConfig = async (params: { userId: number }) => {
  return await request.get<{
    maxCount: number
    level: string
    onceCount: number
  }>({ url: `/crm/customer-limit-config/getByUserId`, params })
}
